package com.alibaba.citrus.cr.unified.inventory.contants;

import com.epoch.app.crunifiedinventory.model.enums.AllocateOrderStatus;

import java.util.HashMap;
import java.util.Map;

/**
 * @description:
 * @author: yuhw
 * @date: 2021年12月16日 16:06
 **/
public class UnifiedInventoryKey {

    //交货单 外部单号
    public static final String CONSIGNMENT_ORDER_OUT_DELIVERY_NO = "CONSIGNMENT_ORDER_OUT_DELIVERY_NO_";

    public static final Integer PART_RECEIVE_2_COMPLETE_VALUE = 100;

    public static String getConsignMentOrderOutDeliveryNo(String outDeliveryNo){
        return CONSIGNMENT_ORDER_OUT_DELIVERY_NO + outDeliveryNo;
    }


    /**
     * 部分发货对应的全部发货状态
     */
    public static final Map<Integer, Integer> PARTIAL_SHIPPED_TO_SHIPPED_MAP = new HashMap<Integer, Integer>() {{
        put(AllocateOrderStatus.Shipment_Processing.getValue(),
                AllocateOrderStatus.Cancel.getValue());

        put(AllocateOrderStatus.Part_Shipped.getValue(),
                AllocateOrderStatus.Shipped.getValue());

        put(AllocateOrderStatus.PART_SHIPPED_NONE_RECEIVED.getValue(),
                AllocateOrderStatus.ALL_SHIPPED_NONE_RECEIVED.getValue());

        put(AllocateOrderStatus.PART_SHIPPED_PART_RECEIVED.getValue(),
                AllocateOrderStatus.ALL_SHIPPED_PART_RECEIVED.getValue());

        put(AllocateOrderStatus.PART_SHIPPED_YARD_NONE_RECEIVED.getValue(),
                AllocateOrderStatus.ALL_SHIPPED_YARD_NONE_RECEIVED.getValue());

        put(AllocateOrderStatus.PART_SHIPPED_YARD_PART_RECEIVED.getValue(),
                AllocateOrderStatus.ALL_SHIPPED_YARD_PART_RECEIVED.getValue());


        // 部分发货，部分收货可能直接推到已完成/货场仓已收货
        put(AllocateOrderStatus.PART_SHIPPED_PART_RECEIVED.getValue() + PART_RECEIVE_2_COMPLETE_VALUE,
                AllocateOrderStatus.COMPLETED.getValue());

        put(AllocateOrderStatus.PART_SHIPPED_YARD_PART_RECEIVED.getValue() + PART_RECEIVE_2_COMPLETE_VALUE,
                AllocateOrderStatus.ALL_SHIPPED_YARD_RECEIVED.getValue());
    }};
}
